$NG.AllReady(function (page, { useAction, useBeforeClick, useValuesChange, useClick, useUpdateRow, subscribe, useUpdateRows }) {
    const mstform = $NG.getCmpApi("p_form_xjjsgzzsbcl_m")
    const dgrid1 = $NG.getCmpApi("")
    const getHeadValue = (str) => mstform.getItem(str).getValue()
    if (page.oType == 'add') {
        const year = new Date().getFullYear()
        $NG.updateState((updater) => {
            updater.data.p_form_xjjsgzzsbcl_m.setProps({
                u_tbnd: {
                    label: year,
                    value: year
                },

            })
        })
    }

    useValuesChange(()=>{
        console.log(`编辑`,);
        getUserInfo()
    },"p_form_xjjsgzzsbcl_m.u_kjgzzxm")

    async function getUserInfo(){
        const phid = mstform.getItem("u_kjgzzxm").getValue()
        console.log(`phid`,phid);
        if(!phid) return 
        const res = await $NG.execServer("getUserInfo",{phid})
        if(res.count == 0) return 
        const datas = JSON.parse(res.data)[0].extendObjects
        $NG.updateState((updater)=>{
            updater.data.p_form_xjjsgzzsbcl_m.setProps({
                u_xb:datas.sexno,
                u_mz:{
                    value:datas.folk,
                    label:datas.folk_exname
                },
                u_dp:datas.political,
                u_xl:{
                    value:datas.edulevel,
                    label:datas.edulevel_exname
                },
                u_zy:datas.special,
                u_jszc:{
                    value:datas.tectitle,
                    label:datas.tectitle_exname
                },
                u_gzbm:{
                    value:datas.phid_dept,
                    label:datas.phid_dept_exname
                },
                u_csrq:datas.birthday,
                u_zw:{
                    label:datas.leadduty_exname,
                    value:datas.leadduty
                }
            })
        }) 
    }
})